\doxysection{Bst\+Tree$<$ Comparable $>$ Class Template Reference}
\label{class_bst_tree}\index{BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}}


A binary search tree.  




{\ttfamily \#include $<$Binary\+Tree.\+h$>$}



Inheritance diagram for Bst\+Tree$<$ Comparable $>$\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_bst_tree__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for Bst\+Tree$<$ Comparable $>$\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_bst_tree__coll__graph}
\end{center}
\end{figure}
\doxysubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ Bst\+Node}
\begin{DoxyCompactList}\small\item\em Node for binary search tree. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual \textbf{ $\sim$\+Bst\+Tree} ()
\item 
virtual void \textbf{ insert} (const Comparable \&x)
\item 
virtual void \textbf{ insert} (Comparable \&\&x)
\item 
virtual void \textbf{ remove} (const Comparable \&x)
\item 
virtual void \textbf{ remove} (Comparable \&\&x)
\item 
const Comparable \& \textbf{ find\+Min} () const
\item 
const Comparable \& \textbf{ find\+Max} () const
\item 
void \textbf{ print\+Tree} (ostream \&out=cout) const
\item 
void \textbf{ make\+Empty} ()
\end{DoxyCompactItemize}
\doxysubsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\textbf{ Bst\+Node} $\ast$ \textbf{ root} = nullptr
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename Comparable$>$\newline
class Bst\+Tree$<$ Comparable $>$}

A binary search tree. 


\begin{DoxyTemplParams}{Template Parameters}
{\em Comparable} & \\
\hline
\end{DoxyTemplParams}


\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\label{class_bst_tree_a75891ab4fdd010a6339864093742ab22}} 
\index{BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}!````~BstTree@{$\sim$BstTree}}
\index{````~BstTree@{$\sim$BstTree}!BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}}
\doxysubsubsection{$\sim$BstTree()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual \textbf{ Bst\+Tree}$<$ Comparable $>$\+::$\sim$\textbf{ Bst\+Tree} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



\doxysubsection{Member Function Documentation}
\mbox{\label{class_bst_tree_a57eb8235cc129e90871524a5c60bc814}} 
\index{BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}!findMax@{findMax}}
\index{findMax@{findMax}!BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}}
\doxysubsubsection{findMax()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
const Comparable\& \textbf{ Bst\+Tree}$<$ Comparable $>$\+::find\+Max (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}

Find the largest item in the tree. Throw Underflow\+Exception if empty. \mbox{\label{class_bst_tree_a4106cfce2da1be70b4b22f1c41e5d406}} 
\index{BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}!findMin@{findMin}}
\index{findMin@{findMin}!BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}}
\doxysubsubsection{findMin()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
const Comparable\& \textbf{ Bst\+Tree}$<$ Comparable $>$\+::find\+Min (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}

Find the smallest item in the tree. \mbox{\label{class_bst_tree_ad1fd360ecaf13dd46d1b3e4030647af1}} 
\index{BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}!insert@{insert}}
\index{insert@{insert}!BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}}
\doxysubsubsection{insert()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual void \textbf{ Bst\+Tree}$<$ Comparable $>$\+::insert (\begin{DoxyParamCaption}\item[{Comparable \&\&}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Reimplemented from \textbf{ Binary\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_binary_tree_aee7222ca2a42b69a5703eb8f77ee2842}.



Reimplemented in \textbf{ Splay\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_splay_tree_adde9d24f5ea5c441e0cee83cce7afedd}, and \textbf{ Avl\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_avl_tree_ad9feb22f565e013c60176ab0dc7adba4}.

\mbox{\label{class_bst_tree_a8c92bedb44279045795259b36031c725}} 
\index{BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}!insert@{insert}}
\index{insert@{insert}!BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}}
\doxysubsubsection{insert()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual void \textbf{ Bst\+Tree}$<$ Comparable $>$\+::insert (\begin{DoxyParamCaption}\item[{const Comparable \&}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

Insert x into the tree; duplicates are ignored. 

Reimplemented from \textbf{ Binary\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_binary_tree_af588056c5cd620cdb6b66e7db4e706b8}.



Reimplemented in \textbf{ Splay\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_splay_tree_a8aee728cd2536dc8306129fa64c1f694}, and \textbf{ Avl\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_avl_tree_aff480dbd38c3803011882dab799871dc}.

\mbox{\label{class_binary_tree_af1cb2a82a7837713d1d0e71cd90a76a0}} 
\index{BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}!makeEmpty@{makeEmpty}}
\index{makeEmpty@{makeEmpty}!BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}}
\doxysubsubsection{makeEmpty()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
void \textbf{ Binary\+Tree}$<$ Comparable $>$\+::make\+Empty (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inherited]}}

Make the tree logically empty. \mbox{\label{class_binary_tree_a2ed034626b76cf27efe77bce17604bc4}} 
\index{BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}!printTree@{printTree}}
\index{printTree@{printTree}!BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}}
\doxysubsubsection{printTree()}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
void \textbf{ Binary\+Tree}$<$ Comparable $>$\+::print\+Tree (\begin{DoxyParamCaption}\item[{ostream \&}]{out = {\ttfamily cout} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inherited]}}

Print the tree contents. \mbox{\label{class_bst_tree_a0251edb51327b40d42e576c885c24334}} 
\index{BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}!remove@{remove}}
\index{remove@{remove}!BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}}
\doxysubsubsection{remove()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual void \textbf{ Bst\+Tree}$<$ Comparable $>$\+::remove (\begin{DoxyParamCaption}\item[{Comparable \&\&}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Reimplemented from \textbf{ Binary\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_binary_tree_aacd21ed74feac2218b95bea652f9f399}.



Reimplemented in \textbf{ Splay\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_splay_tree_af020a5b6cf5934071739aad949802edd}, and \textbf{ Avl\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_avl_tree_ab79e0850047dec805260735bb35d1b51}.

\mbox{\label{class_bst_tree_a7cb0b1bd945708ccf9e4af1905b6ac95}} 
\index{BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}!remove@{remove}}
\index{remove@{remove}!BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}}
\doxysubsubsection{remove()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
virtual void \textbf{ Bst\+Tree}$<$ Comparable $>$\+::remove (\begin{DoxyParamCaption}\item[{const Comparable \&}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

Remove x from the tree. Nothing is done if x is not found. 

Reimplemented from \textbf{ Binary\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_binary_tree_a1fe5e6e0b3266169eaaf8e16997c804e}.



Reimplemented in \textbf{ Splay\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_splay_tree_a4dfaad055380b8384d9365823e224bf0}, and \textbf{ Avl\+Tree$<$ Comparable $>$} \doxyref{}{p.}{class_avl_tree_af87eb93a5639ae6d3661ce1c93680e14}.



\doxysubsection{Member Data Documentation}
\mbox{\label{class_bst_tree_a951cbcd212eef53b7c1e0d183411a608}} 
\index{BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}!root@{root}}
\index{root@{root}!BstTree$<$ Comparable $>$@{BstTree$<$ Comparable $>$}}
\doxysubsubsection{root}
{\footnotesize\ttfamily template$<$typename Comparable $>$ \\
\textbf{ Bst\+Node}$\ast$ \textbf{ Bst\+Tree}$<$ Comparable $>$\+::root = nullptr\hspace{0.3cm}{\ttfamily [private]}}



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\textbf{ Binary\+Tree.\+h}\end{DoxyCompactItemize}
